<?php
$keyword = $_GET['keyword'];
$page = !($_GET['page'])?'1':intval($_GET['page']);
$pagesize = 20;
$page2 = ($page-1) * $pagesize;

$sql = "select * from " . $BIAOTOU . $role . " where (name like '%" . $keyword . "%')";
$rs = mysql_query($sql);
$total = mysql_num_rows($rs);

$sql = "select * from " . $BIAOTOU . $role . " where (name like '%" . $keyword . "%') order by id  desc limit $page2,$pagesize";
$rs = mysql_query($sql);

$jibie = sel_arr_sql("role", "*", "status=1");

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理中心</title>
<link href="../css/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE3 {color: #FF0000}
-->
</style>
<script language='javascript'>
function del($url)
{
if (confirm('确实要删除？')){
location.href=$url;
}
}
</script>
</head>

<body topmargin="5" leftmargin="0">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="282" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td>
          <table cellspacing="0" width="100%" height="207" style="border:1px  solid #DCEAF7;">
            <tr>
              <td width="440" height="30" bgcolor="E9F2FB" class="bigtext"><strong>&nbsp;<img src="../../images/arrow.gif" width="16" height="22" align="absmiddle" /> 管理员管理 [ <a href="admin.php?act=addqx" class="link3">新增权限组</a> ] </strong></td>
              <form id="form1" name="form1" method="get" action="">
              <input type="hidden" name="act" value="qxlist"/>
              <td width="348" height="30" bgcolor="E9F2FB" class="bigtext">
                <label>权限组名称
                  <input type="text" class="btn3" name="keyword" />
                </label>
                            <label>
                            <input type="submit" name="Submit" value="查找" />
                            </label>
             
              </td> </form>
              <td width="188" align="right" bgcolor="E9F2FB" class="bigtext">共有 <b><?php echo $total;
?></b> 条记录&nbsp;&nbsp;</td>
            </tr>
            <tr>
              <td colspan="3" valign="top"><table width="100%" height="300" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td valign="top"><table width="100%" border=1 cellpadding=0 cellspacing=0
style="border-collapse: collapse" bordercolor="#dddddd">
                  
                    <tr>
                      <td width="11%"  height="30" align="center" bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;ID</strong></td>
                      <td width="11%"  height="30" bgcolor="#F2F2F2" class="bigtext"><strong>名称</strong></td>
					  <td width="11%" bgcolor="#F2F2F2"  align="center" class="bigtext">&nbsp;<strong>状态</strong></td>
                      <td width="11%"  align="center" bgcolor="#F2F2F2" class="bigtext"><strong>&nbsp;修改</strong></td>
                    </tr>
					<?php
while ($row = mysql_fetch_array($rs)) {
	echo "<tr>";
	echo "<td height=30 class=bigtext align=\"center\">&nbsp;" . $row["id"] . "</td>";
	echo "<td height=30 class=bigtext>&nbsp;" . $row["name"] . "</td>";
	echo "<td height=30 class=bigtext align=\"center\">&nbsp;" . $row["status"] . "</td>";
	echo "<td align=center class=bigtext><a href=admin.php?act=addqx&id=" . $row["id"] . " class=link4>修改</a> <a href=# onclick=del('admin.php?act=delqx&id=" . $row["id"] . "') class=link4>删除</a></td>";
	echo "</tr>";
} 

?>
                  </table>
				  <div class="yahoo2" style=" margin-top:30px;"><?php
pageft($total, $pagesize, 1, 1, 0, 10, "admin.php?act=qxlist&keyword=" . urlencode($keyword));
echo $pagenav;
?></div></td>
                </tr>
              </table></td>
            </tr>
          </table></td>
        </tr>
      
    </table></td>
  </tr>
</table>
</body>
</html>
<?php mysql_close();
?>
